import urllib.request

url = 'https://www.google.com/'

header = {
    'user-Agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36'
}

req = urllib.request.Request(url,headers=header)

resp = urllib.request.urlopen(req)
h = resp.read().decode('utf-8')

print(h)